<!DOCTYPE html>
<html class="no-js" lang="">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>我的钱包</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/meanmenu.min.css">
    <link rel="stylesheet" href="css/owl.carousel.css">
    <link rel="stylesheet" href="css/owl.theme.css">
    <link rel="stylesheet" href="css/owl.transitions.css">
    <link rel="stylesheet" href="css/nivo-slider.css">
    <link rel="stylesheet" href="css/jquery-ui-slider.css">
    <link rel="stylesheet" type="text/css" href="css/jquery.simpleLens.css">
    <link rel="stylesheet" type="text/css" href="css/jquery.simpleGallery.css">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="css/responsive.css">
    <script src="js/vendor/modernizr-2.8.3.min.js"></script>
    <script src="layui/css/layui.css" media="all"></script>
</head>
<body>
<!--头部-->
<div id="header11"></div>

<div class="breadcurb-area">
    <div class="container">
        <ul class="breadcrumb">
            <li class="home"><a href="index.html">首页</a>
            <li>
            <li><a href="myWallet.html">我的钱包</a>
            <li>
        </ul>
    </div>
</div><!-- End Breadcurb Area -->

<div class="wishlist-area">
    <div class="container">

    </div>
</div>
<div class="chart-area">
    <div class="container">
        <div class="row">
            <div class="col-md-12" id="massgae">
                <!--订单信息DIV-->
                <div id="orderMassage" class="chart-item table-responsive fix">
                    <div class="col-md-12">
                        <label>余额：</label>
                        <input style="color: red" type="tel" name="amount" disabled="disabled" value=""><a>元</a>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="cart-title">
                            <div class="col-md-4">
                                <input type="button" class="btn btn-primary btn-lg" onclick="addAmount()" value="充值">
                                <input type="tel" name="addmoney">
                            </div>
                            <div class="col-md-4">
                                <input type="button" class="btn btn-primary btn-lg" onclick="deleteAmount()" value="提现">
                                <input type="tel" name="deletemoney">
                            </div>
                        </div>

                        <div class="table-responsive" id="deposit">
                            <table class="table table-bordered table-hover" id="depositTable">
                                <thead>
                                <tr>
                                    <th>商品名</th>
                                    <th>商品描述</th>
                                    <th>押金（元）</th>
                                    <th>押金状态</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr style="color: black" v-for="(deposit) in deposits">
                                    <td>{{deposit.gname}}</td>
                                    <td>{{deposit.gdescribe}}</td>
                                    <td>{{deposit.cash}}</td>
                                    <td>
                                        <template v-if="deposit.pStatus == '1'">
                                            <button @click="returnMoney(deposit.gid,deposit.aid)">退换押金</button>
                                        </template>
                                        <template v-else-if="deposit.pStatus == '2'">
                                            <a style="color: red">已退</a>
                                        </template>
                                        <template v-else>
                                            <a>冻结</a>
                                        </template>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--底部-->
<div id="footer11"></div>

<script src="js/vendor/jquery-1.11.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.nivo.slider.pack.js"></script>
<script src="js/jquery.meanmenu.min.js"></script>
<script src="js/jquery-price-slider.js"></script>
<script type="text/javascript" src="js/jquery.simpleGallery.min.js"></script>
<script type="text/javascript" src="js/jquery.simpleLens.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.scrollUp.min.js"></script>
<script src="js/dbclick.min.js"></script>
<script src="js/jquery.countdown.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/vue.min.js"></script>
<script src="layui/layui.js"></script>
</body>
<script>

    //页面固定头尾
    $(function () {
        $('#header11').load("auction-head.html");
        $('#footer11').load('auction-footer.html');
    })


    /*充值*/
    window.addAmount = () => {
        let total_amount = $("[name='addmoney']").val();
        if (total_amount==""){
            alert("亲，充多少呢？");
            return;
        }
        window.location.href="/web-order/alipay/pay/"+total_amount;
    }


    /*提现*/
    window.deleteAmount = () => {
        let money = $("[name='deletemoney']").val();
        console.log(money);
        alert("功能开发中，敬请期待");
    }

    /*余额查询*/
    window.myWallet = () => {
        let uid = 1;
        $.ajax({
            url: "/web-user/user/showMoney/" + uid,
            method: "get",
            success: function (result) {
                console.log(result);
                $("[name = 'amount']").val(result);
            }
        })
    }

    /*竞拍查询*/
    window.showAuction = () =>{
        $.ajax({
            url:"/web-auction-chat/balance/selectDeposit",
            method:"get",
            success:function (result) {
                console.log(result);
                depositTable.deposits = result;
            }
        })
    }

    let depositTable = new Vue({
        el:"#deposit",
        data:{
            deposits:{}
        },
        methods:{
            returnMoney:function (gid,aid) {
                console.log(gid+","+aid);
                $.ajax({
                    url:"/web-auction-chat/balance/returnDeposit/"+aid+"/"+gid,
                    method:"get",
                    success:function (result) {
                        location.reload();
                    }
                })
            }
        }
    })

    /*页面数据加载*/
    window.onload = function () {
        myWallet();
        showAuction();
    }
</script>
</html>